import request from '@/utils/request'

//查询所有的品牌数据(分页)
export const getSelectAllAPI = (pageNum, pageSize) => {
  return request({
    url: `/api/brand/selectAll/${pageNum}/${pageSize}`,
    method: 'get',
  })
}
//查询所有的品牌数据
export const getListAPI = () => {
  return request({
    url: '/api/brand/list',
    method: 'get',
  })
}

//添加
export const postSaveAPI = data => {
  return request({
    url: '/api/brand/save',
    method: 'post',
    data,
  })
}

//修改
export const putUpdateAPI = data => {
  return request({
    url: '/api/brand/update',
    method: 'put',
    data,
  })
}

//删除
export const deleteAPI = id => {
  return request({
    url: `/api/brand/delete/${id}`,
    method: 'delete',
  })
}

//查询分类品牌
export const getSelectCategoryBrandAPI = (
  pageNum,
  pageSize,
  categoryBrandDto
) => {
  return request({
    url: `/api/brand/selectCategoryBrand/${pageNum}/${pageSize}`,
    method: 'post',
    data: categoryBrandDto,
  })
}

//删除分类品牌
export const deleteCategoryBrandAPI = id => {
  return request({
    url: `/api/brand/deleteCategoryBrand/${id}`,
    method: 'delete',
  })
}

//添加分类品牌
export const postSaveCategoryBrandAPI = CategoryBrand => {
  return request({
    url: '/api/brand/saveCategoryBrand',
    method: 'post',
    data: CategoryBrand,
  })
}

//修改分类品牌
export const putUpdateCategoryBrandAPI = data => {
  return request({
    url: '/api/brand/updateCategoryBrand',
    method: 'put',
    data,
  })
}